package com.bigflexlib.x.flash.events
{



	import flash.events.Event;
	import flash.events.IEventDispatcher;




	/**
	 * 
	 * A super generic event that indicates a value has changed
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class ValueChangedEvent extends Event
	{
		
		public static const VALUE_CHANGED:String = "valueChanged";
		
		
		private var _value:*;
		public function get value( ):*
		{
			return _value;
		}
			
		
		public function ValueChangedEvent( type:String, value:*=undefined, bubbles:Boolean=false, cancelable:Boolean=false )
		{
			
			_value = value;
			
			super( type, bubbles, cancelable );
		}
		
		
		/**
		 * 
		 * A convenience method to cover the usual dispatch dialect for this event type.
		 * 
		 * @param dispatcher
		 * @param value
		 * 
		 */		
		public static function dispatch( dispatcher:IEventDispatcher, value:*=undefined ):void
		{
			dispatcher.dispatchEvent( new ValueChangedEvent( ValueChangedEvent.VALUE_CHANGED, value ) );
		}
		
		
		override public function clone():Event
		{
		
			return new ValueChangedEvent( type, value, bubbles, cancelable );
		
		}
		

	}

}
